/*     */ package com.cr.business;
/*     */ 
/*     */ import com.cr.business.domain.CrServiceApplicationRecord;
/*     */ import com.cr.business.domain.CrUser;
/*     */ import com.cr.business.service.ICrServiceApplicationRecordService;
/*     */ import com.cr.business.service.ICrUserService;
/*     */ import com.cr.common.annotation.Log;
/*     */ import com.cr.common.core.controller.BaseController;
/*     */ import com.cr.common.core.domain.AjaxResult;
/*     */ import com.cr.common.core.page.TableDataInfo;
/*     */ import com.cr.common.enums.BusinessType;
/*     */ import com.cr.common.utils.poi.ExcelUtil;
/*     */ import java.util.List;
/*     */ import org.apache.shiro.authz.annotation.RequiresPermissions;
/*     */ import org.springframework.beans.factory.annotation.Autowired;
/*     */ import org.springframework.stereotype.Controller;
/*     */ import org.springframework.ui.ModelMap;
/*     */ import org.springframework.web.bind.annotation.GetMapping;
/*     */ import org.springframework.web.bind.annotation.PathVariable;
/*     */ import org.springframework.web.bind.annotation.PostMapping;
/*     */ import org.springframework.web.bind.annotation.RequestMapping;
/*     */ import org.springframework.web.bind.annotation.ResponseBody;
/*     */ 
/*     */ @Controller
/*     */ @RequestMapping({"/business/apply"})
/*     */ public class CrServiceApplicationRecordController extends BaseController {
/*  35 */   private String prefix = "business/apply";
/*     */   
/*     */   @Autowired
/*     */   private ICrServiceApplicationRecordService crServiceApplicationRecordService;
/*     */   
/*     */   @Autowired
/*     */   private ICrUserService userService;
/*     */   
/*     */   @RequiresPermissions({"business:apply:view"})
/*     */   @GetMapping
/*     */   public String apply(ModelMap mmap) {
/*  46 */     CrUser user = new CrUser();
/*  47 */     user.setUserType(Integer.valueOf(0));
/*  48 */     mmap.put("userList", this.userService.selectCrUserList(user));
/*  50 */     user.setUserType(Integer.valueOf(1));
/*  51 */     mmap.put("lawyerList", this.userService.selectCrUserList(user));
/*  52 */     return this.prefix + "/apply";
/*     */   }
/*     */   
/*     */   @RequiresPermissions({"business:apply:list"})
/*     */   @PostMapping({"/list"})
/*     */   @ResponseBody
/*     */   public TableDataInfo list(CrServiceApplicationRecord crServiceApplicationRecord) {
/*  63 */     startPage();
/*  64 */     List<CrServiceApplicationRecord> list = this.crServiceApplicationRecordService.selectCrServiceApplicationRecordList(crServiceApplicationRecord);
/*  65 */     return getDataTable(list);
/*     */   }
/*     */   
/*     */   @RequiresPermissions({"business:apply:export"})
/*     */   @Log(title = "金点子服务申请记录", businessType = BusinessType.EXPORT)
/*     */   @PostMapping({"/export"})
/*     */   @ResponseBody
/*     */   public AjaxResult export(CrServiceApplicationRecord crServiceApplicationRecord) {
/*  77 */     List<CrServiceApplicationRecord> list = this.crServiceApplicationRecordService.selectCrServiceApplicationRecordList(crServiceApplicationRecord);
/*  78 */     ExcelUtil<CrServiceApplicationRecord> util = new ExcelUtil(CrServiceApplicationRecord.class);
/*  79 */     return util.exportExcel(list, "金点子服务申请记录数据");
/*     */   }
/*     */   
/*     */   @GetMapping({"/add"})
/*     */   public String add(ModelMap mmap) {
/*  88 */     CrUser user = new CrUser();
/*  89 */     user.setUserType(Integer.valueOf(0));
/*  90 */     mmap.put("userList", this.userService.selectCrUserList(user));
/*  92 */     user.setUserType(Integer.valueOf(1));
/*  93 */     mmap.put("lawyerList", this.userService.selectCrUserList(user));
/*  94 */     return this.prefix + "/add";
/*     */   }
/*     */   
/*     */   @RequiresPermissions({"business:apply:add"})
/*     */   @Log(title = "金点子服务申请记录", businessType = BusinessType.INSERT)
/*     */   @PostMapping({"/add"})
/*     */   @ResponseBody
/*     */   public AjaxResult addSave(CrServiceApplicationRecord crServiceApplicationRecord) {
/* 106 */     return toAjax(this.crServiceApplicationRecordService.insertCrServiceApplicationRecord(crServiceApplicationRecord));
/*     */   }
/*     */   
/*     */   @GetMapping({"/edit/{applyId}"})
/*     */   public String edit(@PathVariable("applyId") Long applyId, ModelMap mmap) {
/* 115 */     CrServiceApplicationRecord crServiceApplicationRecord = this.crServiceApplicationRecordService.selectCrServiceApplicationRecordByApplyId(applyId);
/* 116 */     mmap.put("crServiceApplicationRecord", crServiceApplicationRecord);
/* 117 */     CrUser user = new CrUser();
/* 118 */     user.setUserType(Integer.valueOf(0));
/* 119 */     mmap.put("userList", this.userService.selectCrUserList(user));
/* 121 */     user.setUserType(Integer.valueOf(1));
/* 122 */     mmap.put("lawyerList", this.userService.selectCrUserList(user));
/* 123 */     return this.prefix + "/edit";
/*     */   }
/*     */   
/*     */   @RequiresPermissions({"business:apply:edit"})
/*     */   @Log(title = "金点子服务申请记录", businessType = BusinessType.UPDATE)
/*     */   @PostMapping({"/edit"})
/*     */   @ResponseBody
/*     */   public AjaxResult editSave(CrServiceApplicationRecord crServiceApplicationRecord) {
/* 135 */     return toAjax(this.crServiceApplicationRecordService.updateCrServiceApplicationRecord(crServiceApplicationRecord));
/*     */   }
/*     */   
/*     */   @RequiresPermissions({"business:apply:remove"})
/*     */   @Log(title = "金点子服务申请记录", businessType = BusinessType.DELETE)
/*     */   @PostMapping({"/remove"})
/*     */   @ResponseBody
/*     */   public AjaxResult remove(String ids) {
/* 147 */     return toAjax(this.crServiceApplicationRecordService.deleteCrServiceApplicationRecordByApplyIds(ids));
/*     */   }
/*     */ }


/* Location:              D:\tmp\creditorRights-admin\BOOT-INF\classes\com.zip!\com\cr\business\CrServiceApplicationRecordController.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */